<?php
	include_once("../model/Model.php");
	$userId = $_REQUEST['id'];
	
	$model = new Model();
	$ans = $model->getFriendList($userId);
	if($ans == 0)
	{
		echo "The person have no friends yet";
	}
	else
	{
		foreach($ans as $row)
		{
			if($row['profilepic'] == "")
			{
				if($row['gender'] == "male")
				{
					$profilepic = "img/male-icon.jpg";
				}
				else
				{
					$profilepic = "img/female-icon.jpg";
				}
			}
			else
			{
				$profilepic = $row['profilepic'];
			}
	?>
						<link rel="stylesheet" href="css/profile.css" type="text/css" media="screen, projection, tv" />
						<script src="js/jquery.min.js"></script>
						<script src="js/script.js"></script>
						<div>
							<div>
								<img alt="" src="<?php echo $profilepic; ?>" width="50" height="50" align="middle" />
								<a href="../index.php?action=showFriendPage&id=<?php echo $row['Id']; ?>" target="_parent" class="linkname" ><?php echo $row['fullname']; ?></a>
							</div>
						</div>
						<hr>
		<?php
		}
	}
	?>